<{include file="admin:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
      <tr>
        <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
        <th><{$MOD.title}></th>
        <td align="right"><{link ctl="weixin/weixin:index" priv="hidden" class="button"}></td>
        <td width="15"></td>
      </tr>
    </table>
</div>
<div class="page-data">
<p class="tip-notice"><b>当有用户关注时自动回复消息</b></p>
<form action="?weixin/weixin-welcome.html" mini-form="weixin-form" method="post" ENCTYPE="multipart/form-data">
<input type="hidden" name="wx_id" value="<{$weixin.wx_id}>"/>
<table width="100%" border="0" cellspacing="0" class="table-data form">
<tr><th>公众号：</th><td><b class="blue"><{$weixin.wx_name}>(<{$weixin.wx_sid}>)</b></td></tr>
<tr>
    <th>回复类型：</th>
    <td>
        <label><input type="radio" name="data[type]" <{if empty($welcome.type) || $welcome.type=='text'}>checked="checked"<{/if}> value="text"/>文本回复</label>
        <label><input type="radio" name="data[type]" <{if $welcome.type=='reply'}>checked="checked"<{/if}> value="reply"/>图文回复</label>&nbsp;&nbsp; <br />
    </td>
</tr>
<tr wxtype="text" <{if $welcome.type && $welcome.type!='text'}>class="hide"<{/if}>>
    <th>回复内容：</th>
    <td><textarea name="data[content]" class="textarea w-300"><{$welcome.content}></textarea></td>
</tr>
<tr wxtype="reply" <{if $welcome.type!='reply'}>class="hide"<{/if}>>
    <th>回复图文：</th>
    <td>
        <input type="hidden" name="data[reply_id]" value="<{$welcome.reply_id}>" id="weixin_reply_id"/>
        <div class="weixin-preview<{if !$reply}> hide<{/if}>" style="float:left;">
            <div class="weixin-box">
                <p class="weixin-title" id="weixin_reply_title"><{$reply.title}></p>
                <div class="weixin-cover"><img class="weixin-cover-pic" id="weixin_reply_photo" src="<{$pager.img}>/<{$reply.photo}>"></div>
            </div>
        </div>
        <{link ctl="weixin/reply:dialog" arg0=$weixin.wx_id id="weixin_reply_btn" title="选择微信素材" class="button"}>
    </td>
</tr>
<tr><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据" /></td></tr>
</table>
</form>
</div>
<script type="text/javascript">
(function(K, $){
$("input[name='data[type]']").click(function(){
    $("tr[wxtype]").hide();
    $("tr[wxtype='"+$(this).val()+"']").show();
});
$("#weixin_reply_btn").click(function(e){
    e.stopPropagation(); e.preventDefault();
    var link = $(this).attr("action") || $(this).attr("href");
    Widget.Dialog.Select(link, 'N', function(ret){
        $("#weixin_reply_id").val(ret[0]);
        $("#weixin_reply_title").html(ret[1].title);
        $("#weixin_reply_photo").attr("src", "<{$pager.img}>/"+ret[1].photo);
        $(".weixin-preview").show();
    }, {title:"选择微信素材",width:720});
});
})(window.KT, window.jQuery);
</script>
<{include file="admin:common/footer.html"}>